<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>
    <div class="user">
        <basic-container>
            <avue-crud
                    v-model="form"
                    v-model:page="page"
                    v-model:search="searchForm"
                    :permission="getPermission"
                    v-bind="bindVal"
                    v-on="onEvent"
                    :option="option"
                    :data="tableData"
                    :before-open="beforeOpen"
            >
<!--                <template #menu-left="{size}">-->
<!--                    <el-button type="primary" @click="importShowHandle()">导入</el-button>-->
<!--                    <el-button type="primary" @click="exportHandle()">导出</el-button>-->
<!--                </template>-->
            </avue-crud>

        </basic-container>

        <import-upload :base-url="pageConfig.url" :model-name="pageConfig.name" v-model="importDialogVisible"  ></import-upload>

    </div>
</template>

<script>
    import curdMixin from '@/framework-core/mixins/crud';
    import ImportUpload from "@/framework-core/components/upload/index.vue";


    export default {
        name: "sys_application",
        mixins: [curdMixin],
        components: {ImportUpload},
        data() {
            return {
                pageConfig:{name:"应用","url":"/sys/app"},
                searchForm: {},
                loading: false,
                form:{},
                option: {
                    "border": true,
                    "index": true,
                    "indexLabel": "#",
                    "stripe": true,
                    "menuAlign": "center",
                    "align": "center",
                    "searchMenuSpan": 6,
                    searchEnter:true,
                    "column": [


                        {
                            "type": "input",
                            "label": "应用名称",
                            "prop": "app",
                            "rules": [{
                                required: true,
                                message: '应用名称不能为空',
                                trigger: 'blur'
                            }],
                            'search': true,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "pc端url",
                            "prop": "pcUrl",
                            "rules": [{
                                required: true,
                                message: 'pc端url不能为空',
                                trigger: 'blur'
                            }],
                            'search': false,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "手机端url",
                            "prop": "sjUrl",
                            "rules": [{
                                required: true,
                                message: '手机端url不能为空',
                                trigger: 'blur'
                            }],
                            'search': false,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "标签",
                            "prop": "tag",
                            "rules": [{
                                required: true,
                                message: '标签不能为空',
                                trigger: 'blur'
                            }],
                            'search': true,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "分类1",
                            "prop": "group1",
                            "rules": [{
                                required: true,
                                message: '分类1不能为空',
                                trigger: 'blur'
                            }],
                            'search': true,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "分类2",
                            "prop": "group2",
                            "rules": [{
                                required: true,
                                message: '分类2不能为空',
                                trigger: 'blur'
                            }],
                            'search': false,
                            "span": 12
                        }


                        ,
                        {
                            "type": "input",
                            "label": "图标",
                            "prop": "icons",
                            "rules": [{
                                required: true,
                                message: '图标不能为空',
                                trigger: 'blur'
                            }],
                            'search': false,
                            "span": 12
                        }


                        ,
                        {
                            "type": "select",
                            "label": "应用类型",
                            "prop": "yylx",
                            dicData: this.$dictObject["yylx"],
                            'search': true,
                            "span": 12
                        }


                        ,
                        {
                            "type": "select",
                            "label": "打开方式",
                            //dicData: this.$dictObject.dkfs,
                            "prop": "dkfs",
                            'search': true,
                            "span": 12
                        }



                        ,
                        {
                            "type": "input",
                            "label": "排序",
                            "prop": "sort",
                            'search': false,
                            "span": 12
                        }

                    ]
                }
            };
        },
        computed: {
            ...mapState({
                permissions: (state) =>state.user.permission,
            })

        },
        created() {
            this.init();
        },
        methods: {
            init() {
            },
            getPermission: function (key, row, index) {
                return this.getCommPermission(key, row, index);
            },

        }
    };
</script>
<style lang="scss">

</style>
